package ltd.dujiabao.routingdatasource.controller;

import ltd.dujiabao.routingdatasource.dao.PersonRepository;
import ltd.dujiabao.routingdatasource.domain.Person;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author Bowie Du
 * @date 2025/11/1 00:24
 */
@RestController
public class PersonController {

    @Autowired
    private PersonRepository personRepository;

    @PostMapping("/person")
    public void addPerson(@RequestBody Person person) {
        personRepository.save(person);
    }
}
